package com.qing.microservices.shirostudy.controller;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author guoqf
 */
@Controller
public class IndexController {

    @RequiresUser
    @RequestMapping("/index")
    public String index(ModelMap map) {
        map.put("username", SecurityUtils.getSubject().getPrincipal());
        return "index";
    }
}
